﻿using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TeamSystem.Data.DataGenerator;
using Microsoft.VisualStudio.TeamSystem.Data.Generators;
using Chaliy.DbPro.Generators.TextAuthoring;
using Chaliy.DbPro.Generators.TextAuthoring.Configuration;
using System.IO;
using Chaliy.DbPro.Generators.Resources;

namespace Chaliy.DbPro.Generators
{
	[GeneratorStyles(DesignerStyles = GeneratorDesignerStyles.FilterOnCoercibleOutputs)]
	public class LoremTextGenerator : TextGenerator
	{
		#region Methods

		protected override ITextAuthor CreateAuthor()
		{
			using (Stream stream = ResourcesAccessor.OpenLoremConfiguration())
			{
				TextConfiguration configuration = TextConfiguration.Load(stream);

				return new RandomTextAuthorFactory(configuration).Create();
			}
		}

		#endregion
	}
}
